import { BrowserModule } from '@angular/platform-browser'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { NgModule } from '@angular/core'

import { AppComponent } from './app.component'
import { LocationStrategy, HashLocationStrategy } from '@angular/common'
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'
import {
  MatAutocompleteModule,
  MatButtonModule,
  MatButtonToggleModule,
  MatCardModule,
  MatCheckboxModule,
  MatChipsModule,
  MatDatepickerModule,
  MatDialogModule,
  MatDividerModule,
  MatExpansionModule,
  MatGridListModule,
  MatIconModule,
  MatInputModule,
  MatListModule,
  MatMenuModule,
  MatNativeDateModule,
  MatPaginatorModule,
  MatProgressBarModule,
  MatProgressSpinnerModule,
  MatRadioModule,
  MatRippleModule,
  MatSelectModule,
  MatSidenavModule,
  MatSliderModule,
  MatSlideToggleModule,
  MatSnackBarModule,
  MatStepperModule,
  MatTableModule,
  MatTabsModule,
  MatToolbarModule,
  MatTooltipModule,
  MatSortModule,
  MatPaginatorIntl,
  MatBottomSheetModule,
  MatTreeModule,
} from '@angular/material'
import { DragDropModule } from '@angular/cdk/drag-drop'
import { AppRoutingModule } from './app-routing.module'
import { InfoCardComponent } from './common/info-card/info-card.component'
import { LoginComponent } from './views/login/login.component'
import { HeaderComponent } from './views/header/header.component'
import { HomeComponent } from './views/home/home.component'
import { NotFoundPageComponent } from './views/error-page/404/404.component'
import { AppStateService } from './service/app-state.service'
import { SideNavComponent } from './views/side-nav/side-nav.component'
import { PubsPageComponent } from './views/publications/pubs-page/pubs-page.component'
import { AppRouterService } from './service/app-router.service'
import { AppPaginator } from './common/app-paginator'
import { AppJWTService } from './service/app-jwt.service'
import { AppJWTModule } from './modules/app-jwt.module'
import { MessageDialogComponent } from './common/message-dialog/message-dialog.component'
import { AppMessageDialogService } from './service/app-message-dialog.service'
import { AppScreenService } from './service/app-screen.service'
import { BottomSheetComponent } from './common/bottom-sheet/bottom-sheet.component'
import { AppBottomSheetService } from './service/app-bottom-sheet.service'
import { AppHttpInterceptorProvider } from './service/app-http-inteceptor.provider'
import { FormsModule } from '@angular/forms'
import { HomeContentTplComponent } from './views/home/home-content-template/home-content.tpl.component'
import { AppSnackBarService } from './common/snack-bar/snack-bar.service'
import { PubCreateComponent } from './views/publications/mg/create/pub-create.component'
import { AppDrawerComponent } from './common/drawer/app-drawer.component'
import { PubDetailComponent } from './views/publications/pub-detail/pub-detail.component'
import { OrgTreeComponent } from './views/org/org-tree/org-tree.component'
import { UserInfoComponent } from './views/system/user-info/user-info.component'
import { RoleAuthMapComponent } from './views/system/role-auth-map/role-auth-map.component'
import { SafeHtmlPipe } from './common/pipe/safe-html.pipe'
import { CKEditorModule } from '@ckeditor/ckeditor5-angular'
import { WelcomeComponent } from './views/home/welcom/welcome.component';


@NgModule({
  declarations: [
    SafeHtmlPipe,
    AppComponent,
    // App Modules ↓↓↓↓↓↓↓
    AppDrawerComponent,
    HeaderComponent,
    InfoCardComponent,
    LoginComponent,
    NotFoundPageComponent,
    HomeComponent,
    HomeContentTplComponent,
    SideNavComponent,
    MessageDialogComponent,
    BottomSheetComponent,
    PubsPageComponent,
    PubCreateComponent,
    PubDetailComponent,
    OrgTreeComponent,
    UserInfoComponent,
    RoleAuthMapComponent,
    WelcomeComponent
    // App Modules ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    HttpClientModule,
    FormsModule,
    AppRoutingModule, // Routing module
    AppJWTModule,
    // third party plug-in
    CKEditorModule,
    // ↓↓↓↓↓↓↓↓↓↓↓↓↓ Materials Ui Modules
    MatAutocompleteModule,
    MatButtonModule,
    MatButtonToggleModule,
    MatCardModule,
    MatCheckboxModule,
    MatChipsModule,
    MatDatepickerModule,
    MatDialogModule,
    MatDividerModule,
    MatExpansionModule,
    MatGridListModule,
    MatIconModule,
    MatInputModule,
    MatListModule,
    MatMenuModule,
    MatNativeDateModule,
    MatPaginatorModule,
    MatProgressBarModule,
    MatProgressSpinnerModule,
    MatRadioModule,
    MatRippleModule,
    MatSelectModule,
    MatSidenavModule,
    MatSliderModule,
    MatSlideToggleModule,
    MatSnackBarModule,
    MatStepperModule,
    MatTableModule,
    MatTabsModule,
    MatToolbarModule,
    MatTooltipModule,
    MatSortModule,
    MatBottomSheetModule,
    MatTreeModule,
    DragDropModule
    // ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ Materials Ui Modules
  ],
  entryComponents: [
    MessageDialogComponent,
    BottomSheetComponent
  ],
  providers: [
    {
      // 路由方式：/#/xxx LocationStrategy
      provide: LocationStrategy,
      useClass: HashLocationStrategy
    }, {
      provide: MatPaginatorIntl,
      useClass: AppPaginator
    },
    {
      provide: HTTP_INTERCEPTORS,
      useClass: AppHttpInterceptorProvider,
      multi: true
    },
    AppBottomSheetService,
    AppScreenService,
    AppJWTService,
    AppMessageDialogService,
    AppSnackBarService,
    AppStateService,
    AppRouterService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
